Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add QualificationModal component #2727

Merged
merged 2 commits into from
Dec 12, 2024
Merged

Add QualificationModal component #2727

merged 2 commits into from
Dec 12, 2024

Conversation

JF-Cozy
Copy link
Collaborator

@JF-Cozy JF-Cozy commented Dec 11, 2024

No description provided.

BREAKING CHANGE: You must have `cozy-client >= 51.6.0` and `cozy-intent >= 2.29.1`
Copy link

bundlemon bot commented Dec 12, 2024

BundleMon

Files updated (1)
Status Path Size Limits
transpiled/react/stylesheet.css
3.32KB (+191B +5.94%) +10%
Unchanged files (2)
Status Path Size Limits
dist/cozy-ui.min.css
20.23KB +10%
dist/cozy-ui.utils.min.css
10.91KB +10%

Total files change +191B +0.54%

Groups updated (1)
Status Path Size Limits
transpiled/react/**
652.08KB (+1.79KB +0.28%) -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

Copy link
Member

@Merkur39 Merkur39 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

const fileCollection = client.collection('io.cozy.files')
const removeQualification = qualificationLabel && id === 'none'

if (!qualificationLabel && removeQualification) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dans removeQualification tu vérifies la valeur booléene qualificationLabel et là tu vérifie juste à côté !qualificationLabel ça a pas trop de sens non ?

Copy link
Collaborator Author

@JF-Cozy JF-Cozy Dec 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Merkur39 tu te rappelles du pourquoi du comment ? (ce composant est un copier/coller d'une autre app avec un refacto pour simplifier, mais je n'ai pas touché au handleClick par exemple)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, en effet il semble que cette condition ne soit jamais vrai 🤔

Je pense que seul removeQualification est suffisant non ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je comprends pas à quoi sert ce return onClose en fait ? 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Il redirigeait à l'origine, ici il hide la modal, mais oui je pense que toute cette condition n'est pas/plus utile 🤔

A confirmer, je loupe peut-être un cas spécifique ?

Copy link
Collaborator Author

@JF-Cozy JF-Cozy Dec 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c'est pour fermer la modal sans rien faire.

Mais même pour "remove" la qualif, c'est à dire cliquer sur "aucun", il faut quand même réellement enlever la qualification je pense. En revanche ça pose la question des metadata 🤔 est-ce qu'on les garde ou non dans ce cas.

Peut-être que dans l'app d'où provient le code, on souhaiter traiter le cas "none" différemment... edit j'ai retrouvé ça vient de https://github.com/cozy/cozy-drive/blob/master/src/modules/views/Modal/QualifyFileView.jsx

ah non c'est pas ça, plus bas on a

   await fileCollection.updateMetadataAttribute(file._id, {
      qualification: removeQualification ? null : item
    })

donc on savait qu'on passerait dedans en cas de remove...

Bon je supprime la condition

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Il faut conserver les metadata, il peut y en avoir d'autres que la qualif 👍

Copy link
Collaborator Author

@JF-Cozy JF-Cozy Dec 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

je voulais dire les metadata associés à la qualif

Copy link
Member

@Merkur39 Merkur39 Dec 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, je ne pense pas non plus, il me semble qu'elles font quand même sens même sans qualif

@JF-Cozy JF-Cozy merged commit e2ebcc0 into master Dec 12, 2024
12 checks passed
@JF-Cozy JF-Cozy deleted the feat/VER-1144-1 branch December 12, 2024 09:36
@cozy-bot
Copy link

🎉 This PR is included in version 114.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants